<extend name="Layout:list" />
<block name="title"><title>日志管理</title></block>
<block name="subnav">
    <a class="btn red-stripe" href="__MODULE__/Log/index">日志查询</a>
</block>

<block name="main">
    <form name="searchform" action="__MODULE__/Log/search" method="get" class="pad-lr-10 form-inline">
        <input type="text" size="20" name="account" class="m-wrap small" value="<?php if(isset($_REQUEST['account'])) echo $_REQUEST['account']; ?>" placeholder="用户名"/>
        <input type="text" size="20" name="login_ip" class="m-wrap small" placeholder="IP"/>
        <select name="status" class="m-wrap small">
            <option value="all" <?php if(isset($_REQUEST['account']) && $_REQUEST['status'] == 'all') echo 'selected'; ?>>登陆状态</option>
            <option value="1" <?php if(isset($_REQUEST['account']) && $_REQUEST['status'] == '1') echo 'selected'; ?>>操作成功</option>
            <option value="0" <?php if(isset($_REQUEST['account']) && $_REQUEST['status'] == '0') echo 'selected'; ?>>操作失败</option>
        </select>
        <?php echo \Org\Util\Form::date("start_time", isset($_REQUEST['start_time']) ? $_REQUEST['start_time'] : '', 1, "class='Wdate m-wrap small' placeholder='开始时间'"); ?> - &nbsp;
        <?php echo \Org\Util\Form::date("end_time", isset($_REQUEST['end_time']) ? $_REQUEST['end_time'] : '', 1, "class='Wdate m-wrap small' placeholder='结束时间'"); ?> &nbsp;
        <input type="submit" value="搜索" class="btn green" name="dosubmit" />
    </form>
    <div class="pad-lr-10 table-list">
        <table width="100%" cellspacing="0">
            <thead>
                <tr>
                    <th width="100px">用户名</th>
                    <th width="100px">模块</th>
                    <th width="100px">操作</th>
                    <th>文件</th>
                    <th width="150px">时间</th>
                    <th width="100px">状态</th>
                    <th width="200px">IP地址</th>
                </tr>
            </thead>
            <tbody>
                <volist name="list" id="vo">
                    <tr>
                        <td align="center"><?php echo $vo['username']; ?></td>
                        <td align="center"><?php echo $vo['module']; ?></td>
                        <td align="center"><?php echo $vo['action']; ?></td>
                        <td><div><?php echo $vo['querystring']; ?></td>
                        <td align="center"><?php echo $vo["date"]; ?></td>
                        <td align="center">
                            <?php echo $vo['status'] == 1 ? "操作成功" : "<font style='color:red'>操作失败</font>"; ?>
                        </td>
                        <td align="center"><?php echo get_location($vo["ip"]); ?></td>
                    </tr>
                </volist>
            </tbody>
        </table>
    </div>
    <div class="mt-20 clearfix">
        <?php echo $page; ?>
        <div class="pull-right form-inline">
            <?php echo \Org\Util\Form::select(C('list_rows_select'), cookie('list_rows_select'), 'class="m-wrap small" name="list_rows_select" onchange="change_list_rows()"'); ?>
        </div>
    </div>
</block>